import axios from "axios";

// 验证手机号是否注册
export const reqVerifyPhone = (phone) => {
  return axios({
    method: "POST",
    url: "/api/regist/verify_phone",
    data: {
      phone,
    },
  });
};

// 发送验证码
export const reqSendCode = (phone) => {
  return axios({
    method: "POST",
    url: "/api/login/digits",
    data: {
      phone,
    },
  });
};

// 验证验证码是否正确
export const reqVerifyCode = (phone, code) => {
  return axios({
    method: "POST",
    url: "/api/regist/verify_code",
    data: {
      phone,
      code,
    },
  });
};

// 注册
export const reqRegister = (phone, password) => {
  return axios({
    method: "POST",
    url: "/api/regist/user",
    data: {
      phone,
      password,
    },
  });
};
